package com.spyx.mapper;

import com.atyx.spyx.model.search.SkuEs;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

//注意:现在操作的是es,而不是数据库
public interface ProductSearchMapper extends ElasticsearchRepository<SkuEs,Long> {

    //查询es中的热销数据(根据hotScore进行降序查询)
    //springData框架自动分析方法名，编写sql语句
    public Page<SkuEs> findByOrderByHotScoreDesc(Pageable pageable);

    //根据方法名自动编写sql语句
    public Page<SkuEs> findByCategoryIdAndWareId(Long categoryId,Long wareId,Pageable pageable);
    public Page<SkuEs> findByCategoryIdAndWareIdAndKeyword(Long categoryId,Long wareId,String keyword,Pageable pageable);

}
